const { Service } = require('../modules')
async function GetServiceList() {
    try {
        const list = await Service.findAll()
        const data=[]
        list.forEach(e => {
            data.push(e.dataValues)
        });
        return data
    } catch (error) {
        console.log(error)
    }
}
async function AddService(data) {
    try {
        const list = await Service.create(data)
        console.log(list)
        if (!list) return '添加失败'
        return '添加成功'
    } catch (error) {
        console.log(error)
    }
}

module.exports = {
    GetServiceList,
    AddService,
}